/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rd.project.model;

import java.io.Serializable;
import java.util.ArrayList;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;


@NamedQueries({
    @NamedQuery(
            name = "Test.getAlleTestenFromVak", 
            query = "SELECT t FROM Test t WHERE t.vakId = :vak"
    ),
        @NamedQuery(
            name = "Test.getIdTest", 
            query = "SELECT t FROM Test t where t.naam = :testnaam"
    ),
        @NamedQuery(
            name = "Test.getTest", 
            query = "SELECT t FROM Test t WHERE t.id = :id"
    )
        
        
})
@Entity
@Table(name="Test")
public class Test implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String naam;
    private int totaal;
    private Long vakId;
    
    public Test(){}

    public String getNaam() {
        return naam;
    }

    public void setNaam(String naam) {
        this.naam = naam;
    }

    public int getTotaal() {
        return totaal;
    }

    public void setTotaal(int totaal) {
        this.totaal = totaal;
    }

    public Long getVakId() {
        return vakId;
    }

    public void setVakId(Long vakId) {
        this.vakId = vakId;
    }

    public Test(Long id, String naam, int totaal, Long vakId) {
        this.id = id;
        this.naam = naam;
        this.totaal = totaal;
        this.vakId = vakId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Test)) {
            return false;
        }
        Test other = (Test) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return naam;
    }
    
}
